<?php

$comments = View::get('demotComments');


if (sizeof($comments) == 0)
{
    echo "Brak komentarzy.";
}
else    
    
foreach ($comments as $c): ?>    
    <div class="comment">
        <?php if (file_exists("./bank/avatar/".$c['id_user'].".jpg")): ?>
            <img src="<?php echo View::getRoot(); ?>/bank/avatar/<?php echo $c['id_user']; ?>.jpg" class="avatar"/>
        <?php else: ?>
            <img src="<?php echo View::getRoot(); ?>/bank/avatar/def.jpg" class="avatar"/>
        <?php endif; ?>
            
        <div class="title"/>
            <?php echo $c['login'] ?><br/>
            <span>
                <?php echo $c['date'] ?><br/>
                Komentował już: <?php echo $c['count_comments'];  ?> raz(y)
            
            </span>
    
        </div>
        <div class="clear"></div>
        <div class="comment-content">        
            <?php echo $c['content'] ?>
        </div>
    </div>
<?php endforeach; ?>


